package com.stateflow.facade.common.util;

/**
 * Created by weiqingming on 2019/4/23.
 * 获取纳秒
 */
public class SeriaNumber {

    private static Long orderNumber = 0l;

    public static String getNumber() {

        synchronized (orderNumber) {

            long l = System.nanoTime();
            //等到下一纳秒
            while (l == orderNumber) {
                l = System.nanoTime();
            }

            orderNumber = l;
        }
        return String.valueOf(orderNumber);
    }
}
